package com.ticket.sass.admin.dto.output.member;

import com.ticket.sass.admin.model.KeyInfoModel;
import com.ticket.sass.common.entity.tenant.MemberCardRechargeEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * @author ywb
 * @date 2024-03-19 11:36
 */
@Data
@ApiModel
public class MemberCardRechargeListOutput {
    @ApiModelProperty(value = "主键")
    private Long id;
    
    @ApiModelProperty(value = "封面图")
    private List<KeyInfoModel> cover;
    
    @ApiModelProperty(value = "充值金额")
    private BigDecimal amount;
    
    @ApiModelProperty(value = "赠送金额")
    private BigDecimal giftAmount;
    
    @ApiModelProperty(value = "是否启用")
    private Boolean enable;
    
    @ApiModelProperty(value = "促销文案")
    private String tips;
    
    @ApiModelProperty(value = "有效开始时间")
    private LocalDate validStartTime;
    
    @ApiModelProperty(value = "有效结束时间")
    private LocalDate validEndTime;
    
    public MemberCardRechargeListOutput() {
    }
    
    public MemberCardRechargeListOutput(MemberCardRechargeEntity entity) {
        this.id = entity.getId();
        this.cover = KeyInfoModel.generationSingle(entity.getCover());
        this.amount = entity.getAmount();
        this.giftAmount = entity.getGiftAmount();
        this.enable = entity.getEnable();
        this.tips = entity.getTips();
        
        
        this.validStartTime = entity.getValidStartTime();
        this.validEndTime = entity.getValidEndTime();
    }
}
